package org.eclipse.unofficial.flexitabs.adapted;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.unofficial.flexitabs.FlexiTab;

import org2.eclipse.ui.part.WorkbenchPart;


public class FlexiPart extends WorkbenchPart {
	private FlexiTab tab;
	
	public FlexiPart(FlexiTab tab) {
		this.tab = tab;
	}
	
	public void setText(String title) {
		this.setPartName(title);
	}

	@Override
	public void createPartControl(Composite parent) {
		tab.getClient().makeComposite(parent);
	}

	@Override
	public void setFocus() {
		tab.getClient().setFocus();
	}

	public FlexiTab getTab() {
		return tab;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		return tab.getTitleImageDescriptor();
	}
}
